package router

import (
	handler "cms/handler/user"
	"github.com/gin-gonic/gin"
	"lib/middleware"
)

func addUserRouters(router *gin.RouterGroup) {
	adminRouter := router
	adminAuthRouter := router

	accountHandler := handler.AccountHandler{}
	adminRouter.POST("/login/mobile", accountHandler.OldNowJoib)
	adminRouter.POST("/login/mobile-tow", accountHandler.MonileLogin)
	adminRouter.POST("/login", accountHandler.OldNowJoib)
	adminRouter.POST("/login-tow", accountHandler.Login)
	adminRouter.POST("/register", accountHandler.Register)
	adminRouter.GET("/gift_page", accountHandler.GetGiftPage)
	adminRouter.POST("/gamekllll", accountHandler.GetGameIDs)

	adHandler := handler.AdHandler{}
	{
		adminRouter.GET("/ad-now/:type", adHandler.GetAdInfo)
		adminRouter.GET("/ad-now-dea/:id", adHandler.GetAdInfoId)
	}

	adminAuthRouter.Use(middleware.SysAuthorizationMiddleware())
	{
		adminAuthRouter.GET("/me", accountHandler.OldNowJoib)
		adminAuthRouter.GET("/me-tow", accountHandler.FetchMeTow)
		adminAuthRouter.GET("/me-game", accountHandler.FetchMeGame)
		adminAuthRouter.GET("/me-game-sl", accountHandler.FetchMeGameSl)

		adminAuthRouter.POST("/join-game", accountHandler.GetGameMoneyTow)
		adminAuthRouter.POST("/join-game-sl", accountHandler.GetGameMoneyTowSl)

		adminAuthRouter.GET("/gold", accountHandler.FetchGold)
		adminAuthRouter.GET("/jiesuo", accountHandler.GetJiesuo)

		adminAuthRouter.POST("/gold/:num", accountHandler.ExchangeGold)
		adminAuthRouter.POST("/parent/:pid", accountHandler.UpdateParent)

		adminAuthRouter.POST("/point", accountHandler.FetchMePoint)
		adminAuthRouter.POST("/yx", accountHandler.FetchMeyx)

		adminAuthRouter.GET("/kefu", accountHandler.GetKefu)
		adminAuthRouter.GET("/gift_page111/:index/:page", accountHandler.GetGiftPage111)
		adminAuthRouter.GET("/me/online-order-num", accountHandler.FetchMeOrderNum)
		adminAuthRouter.GET("/me/authinfo", accountHandler.FetchMeAuthinfo)

		adminAuthRouter.GET("/sms/captcha-user", accountHandler.GetSmsPicUser)
		adminAuthRouter.GET("/sms/captcha-user-new", accountHandler.GetSmsPicUser)
		adminAuthRouter.POST("/jihuo", accountHandler.Jihuo)

		adminAuthRouter.POST("/me", accountHandler.UpdateMe)
		adminAuthRouter.POST("/activation", accountHandler.Activation)
		adminAuthRouter.POST("/activation-add/:num", accountHandler.ActivationCreate)
		adminAuthRouter.POST("/activation-check/:num", accountHandler.ActivationCreateCheck)
		adminAuthRouter.DELETE("/me", accountHandler.Logout)
		adminAuthRouter.POST("/zhuxiao", accountHandler.Zhuxiao)

		adminAuthRouter.GET("/me/userinfo/:sid", accountHandler.GetUSerInfo)
		adminAuthRouter.GET("/me/userinfo-new/:sid", accountHandler.GetUSerInfoNew)

		adminAuthRouter.GET("/me/userinfo-tz/:sid", accountHandler.GetUSerInfoTz)
		adminAuthRouter.GET("/me/userinfo-tq/:sid", accountHandler.GetUSerInfoTq)

		adminAuthRouter.POST("/me/userinfo", accountHandler.UpdateUSerInfo)

		adminAuthRouter.POST("/me/password", accountHandler.UpdatePassword)
		adminAuthRouter.POST("/me/pay-password", accountHandler.UpdatePayPassword)
		adminAuthRouter.GET("/user-logs", accountHandler.GetUserLogs)
		adminAuthRouter.GET("/user-logs-rank", accountHandler.GetUserLogsRank)
		adminAuthRouter.GET("/unlock-logs", accountHandler.GetUnlockLogs)
		adminAuthRouter.GET("/tz-extract", accountHandler.GetTzExtract)

		adminAuthRouter.POST("/unlock-logs/:id", accountHandler.PutUnlockLogs)

		adminAuthRouter.GET("/user-jihuo", accountHandler.GetJiHuos)
		adminAuthRouter.GET("/user-jihuo-now", accountHandler.GetJiHuosNow)
		adminAuthRouter.GET("/user-jihuo-duihuan", accountHandler.GetJiHuosNowDuihuan)

		adminAuthRouter.GET("/user-child-now", accountHandler.GetChildNow)

		adminAuthRouter.GET("/user-logs-new", accountHandler.GetUserLogsNew)
		adminAuthRouter.GET("/user-logs-new-tz", accountHandler.GetUserLogsNewTz)
		adminAuthRouter.GET("/games", accountHandler.GetGames)
		adminAuthRouter.GET("/game", accountHandler.GetGame)
		adminAuthRouter.GET("/game/:gameId", accountHandler.GetGameID)

		adminAuthRouter.GET("/game-all", accountHandler.GetGameAll)
		adminAuthRouter.GET("/game-money", accountHandler.GetGameMe)
		adminAuthRouter.POST("/game-money", accountHandler.GetGameMoney)

		{
			adminAuthRouter.GET("/iron-elm/me", accountHandler.GetIronElmMe)
			adminAuthRouter.POST("/iron-elm/buy", accountHandler.GetIronElmBuy)
			adminAuthRouter.POST("/iron-elm/level", accountHandler.GetIronElmLevel)
			adminAuthRouter.GET("/iron-elm", accountHandler.GetIronElmList)
			adminAuthRouter.GET("/iron-elm/:tqid", accountHandler.GetIronElmListTieqiu)
			adminAuthRouter.PUT("/iron-elm", accountHandler.GetIronElmSwitch)
			adminAuthRouter.GET("/iron-elm/sms", accountHandler.SendSms)
			adminAuthRouter.POST("/iron-elm/send", accountHandler.SendTieqiu)
			adminAuthRouter.POST("/iron-elm/confirm", accountHandler.SendTieqiuConfirm)
			adminAuthRouter.GET("/iron-elm/transaction", accountHandler.GetIronTransactionElmList)

			adminAuthRouter.GET("/iron-ore", accountHandler.GetIronOreList)
			adminAuthRouter.POST("/iron-ore/sell", accountHandler.GetIronOreSell)
			adminAuthRouter.POST("/iron-ore/sell-all", accountHandler.GetIronOreSellAll)
			adminAuthRouter.POST("/iron-ore/sell-all-tow", accountHandler.GetIronOreSellAllTow)
			adminAuthRouter.GET("/iron-ore/sell-all/:orderId", accountHandler.GetSellStatus)

		}

		adminAuthRouter.GET("/game-money-new", accountHandler.GetGameMeNew)
		adminAuthRouter.POST("/game-money-point", accountHandler.GetGameMoneyPoint)
		adminAuthRouter.POST("/game-money-tz", accountHandler.GetGameMoneyTz)
		adminAuthRouter.POST("/game-money-week", accountHandler.GetGameMoneyWeeks)

		adminAuthRouter.GET("/user-level", accountHandler.GetUserLogsLevel)
		adminAuthRouter.GET("/online-order-level-list/:page", accountHandler.GetOnlineOrderLevel)
		adminAuthRouter.GET("/online-order-level-top", accountHandler.GetUserLogsLevelTop)

		adminAuthRouter.GET("/notice", accountHandler.GetNotice)
		adminAuthRouter.GET("/notice/:id", accountHandler.GetNoticeDetail)

		//adminAuthRouter.POST("/package/buy", accountHandler.BuyPackage)
		//adminAuthRouter.POST("/package/buy-new", accountHandler.BuyPackageNew)
		adminAuthRouter.POST("/package/buy-new-tow", accountHandler.BuyPackageNewTow)
		adminAuthRouter.POST("/package/buy-new-thire", accountHandler.BuyPackageNewTow)
		adminAuthRouter.POST("/package/buy-new-four", accountHandler.BuyPackageNewThire)

		adminAuthRouter.GET("/package/:type/:page", accountHandler.GetMyRunPackage)
		//adminAuthRouter.GET("/package", accountHandler.GetMyPackage)
		//adminAuthRouter.POST("/package", accountHandler.LqPackage)
		//adminAuthRouter.POST("/zhuanru/:type", accountHandler.ZhuanZhang)

		adminAuthRouter.POST("/exchange/:type", accountHandler.Exchange)
		adminAuthRouter.POST("/exchange-qr/:id", accountHandler.ExchangeQr)
		adminAuthRouter.POST("/exchange-qr-tz/:id", accountHandler.ExchangeQrTz)

		//adminAuthRouter.GET("/gift", accountHandler.GetGift)

		adminAuthRouter.GET("/myChild/:type/:page/:sn", accountHandler.GetMyChild)
		adminAuthRouter.GET("/myChild/:type/:page", accountHandler.GetMyChild)
		adminAuthRouter.GET("/myChild/user/:uid", accountHandler.GetMyChildDetail)
		adminAuthRouter.POST("/myChild/user/:uid/:beizhu", accountHandler.MyChildDetailBeizhu)
		adminAuthRouter.POST("/myChild/user/:uid/", accountHandler.MyChildDetailBeizhu)
		adminAuthRouter.POST("/myChild/user/:uid", accountHandler.MyChildDetailBeizhu)

		adminAuthRouter.GET("/wmyChild/:type/:page", accountHandler.WGetMyChild)
		adminAuthRouter.GET("/wmyChild-tow/:type/:page", accountHandler.WGetMyChildTow)

		adminAuthRouter.GET("/steam", accountHandler.GetMySteam)
		adminAuthRouter.GET("/wsteam", accountHandler.WGetMySteam)

		adminAuthRouter.GET("/invite", accountHandler.GetInvite)

		//adminAuthRouter.POST("/gift-money-new/:uid", accountHandler.GifMoneyNewTow)
		//adminAuthRouter.POST("/gift-money-new-tow/:uid", accountHandler.GifMoneyNewTow)
		adminAuthRouter.POST("/gift-money-new-third/:uid", accountHandler.GifMoneyNewThird)
		adminAuthRouter.POST("/apply-auth", accountHandler.ApplyAuth)
		adminAuthRouter.POST("/apply-auth-two", accountHandler.ApplyAuthTow)
		adminAuthRouter.GET("/apply-auth", accountHandler.ApplyAuthInfo)
		adminAuthRouter.POST("/apply-auth-ocr", accountHandler.ApplyAuthOCR)

		adminAuthRouter.POST("/bind-alipay", accountHandler.BindAlipayHanlde)
		adminAuthRouter.GET("/otc-order", accountHandler.GetMyOtcInfo)
		adminAuthRouter.GET("/otc-order/:type/:page", accountHandler.GetMyOtcOrder)
		adminAuthRouter.GET("/otc-order-user/:searchKey/:page", accountHandler.GetMyOtcOrderPage)

		adminAuthRouter.POST("/otc-order/:num", accountHandler.GetMyOtcCreate)
		adminAuthRouter.GET("/otc-order-detail/:id", accountHandler.GetMyOtcInfoDetail)
		adminAuthRouter.POST("/otc-order-detail/:id", accountHandler.OtcInfoGet)
		adminAuthRouter.POST("/update/image", handler.UploadFile)

		adminAuthRouter.POST("/otc-order-detail-update/:id", accountHandler.OtcInfoUpdateFile)
		adminAuthRouter.POST("/otc-order-detail-fx/:id", accountHandler.OtcInfoFangXing)
		adminAuthRouter.POST("/otc-order-detail/delete/:id", accountHandler.OtcInfoFangXingDel)
		adminAuthRouter.POST("/otc-order-detail-l/:id/:num", accountHandler.OtcInfoTouFang)

		{
			adminAuthRouter.GET("/ad", adHandler.AdList)
			adminAuthRouter.POST("/ad/:id", adHandler.AdCreate)
			adminAuthRouter.GET("/ad-user/:page/:type", adHandler.GetAdListUser)
			adminAuthRouter.GET("/address/:page", adHandler.GetAddress)
			adminAuthRouter.POST("/address/:id", adHandler.CreateAddress)
			adminAuthRouter.POST("/address/delete/:id", adHandler.DeleteAddress)
			adminAuthRouter.GET("/address-deatail/:id", adHandler.GetAddressDetail)
			adminAuthRouter.GET("/jijin", adHandler.Jijin)
			adminAuthRouter.GET("/flish", adHandler.Flish)
			adminAuthRouter.GET("/flish-tu/:xindex", adHandler.FlishTu)

			adminAuthRouter.POST("/piao/:types", adHandler.Piao)
			adminAuthRouter.POST("/flish/:types", adHandler.BuyuPiao)
			adminAuthRouter.POST("/flish", adHandler.Flishweiyang)

		}

		productHandel := handler.ProductHandel{}
		{
			adminAuthRouter.POST("/product", productHandel.CreateOrderHandel)
			adminAuthRouter.POST("/product-point", productHandel.CreateOrderPointHandel)
			adminAuthRouter.GET("/pro-order/:type/:page", productHandel.GetProOrderHandel)
			adminAuthRouter.GET("/pro-order-dea/:id", productHandel.GetProOrderDetailHandel)
			adminAuthRouter.GET("/pro-order-address/:id", productHandel.GetProOrderDetailAddressHandel)
			adminAuthRouter.POST("/pro-online-order/:orderSn", productHandel.CreateOnlineOrder)

			adminAuthRouter.POST("/pro-online-order/:orderSn/:orderType", productHandel.CreateOnlineOrderTow)
			adminAuthRouter.POST("/w-online-order/:orderId", productHandel.CreateWOrderTow)

			adminAuthRouter.POST("/tz-extract/:num", productHandel.CreateTzTiqu)

			adminAuthRouter.POST("/pro-online-order-level/:orderSn/:orderType", productHandel.CreateOnlineOrderTowLevel)
			adminAuthRouter.POST("/pro-online-order", productHandel.CreateOnlineOrder)

			adminAuthRouter.POST("/pro-child-order/:orderSn", productHandel.CreateChildOrderTow)

		}

		imHandel := handler.ImHandler{}
		{
			adminAuthRouter.GET("/im/token", imHandel.Token)
			adminAuthRouter.GET("/new-msg", imHandel.NewMsg)
			adminAuthRouter.GET("/new-msg-ll", imHandel.NewMsgKL)

			adminAuthRouter.GET("/wenjiaosuo", adHandler.GetWenjiaosuo)
			adminAuthRouter.PUT("/wenjiaosuo", adHandler.PutWenjiaosuo)

		}

		filshHandel := handler.FlishHandler{}
		{
			adminAuthRouter.GET("/flishs", filshHandel.GetMe)
			adminAuthRouter.POST("/tiqu", filshHandel.Tiqu)
			adminAuthRouter.POST("/zhauzneng/:uid", filshHandel.Zhaunzneg)
			adminAuthRouter.GET("/flishs/task", filshHandel.GetFlishTask)
			adminAuthRouter.POST("/flishs/task/:id", filshHandel.PushTask)
			adminAuthRouter.POST("/flishs/song/:id", filshHandel.PushTaskSong)
		}

	}
}
